package spring.example.cloud.controller;

import cloud.estate.commons.bean.Parking;
import cloud.estate.commons.util.JsonResult;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import spring.example.cloud.service.parkingService;

@RestController
@RequestMapping("/parking")
public class parkingController {
    @Resource
    private parkingService parkingService;
    @RequestMapping("/addOneParking")
    public JsonResult addOneParking(Parking parking){
        return parkingService.addOneParking(parking);
    }
    @RequestMapping("/deleteOneParking")
    public JsonResult deleteOneParking(String id){
        return parkingService.deleteOneParking(id);
    }
    @RequestMapping("/updateOneParking")
    public JsonResult updateOneParking(Parking parking){
        return parkingService.updateOneParking(parking);
    }
    @RequestMapping("/getOneParking")
    public JsonResult getOneParking(String id){
        return parkingService.getOneParking(id);
    }
    @RequestMapping("/listAllParking")
    public JsonResult listAllParking(){
        return parkingService.listAllParking();
    }
}
